<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<title>CalendarLite Widget Test</title>

		<script src="boilerplate.js"></script>

		<script type="text/javascript">
			require(["doh/runner", "dojo/date/stamp", "dojo/dom", "dijit/CalendarLite", "dojo/domReady!"],
					function(doh, stamp, dom, CalendarLite){

				doh.register("CalendarLite", [
					function create(){
						cal = new CalendarLite({
							id: "cal",
							value: "1999-12-31",
							onChange: function myHandler(id,newValue){
								console.debug("onChange for id = " + id + ", value: " + newValue);
							}
						}, dom.byId("calendar1"));

						doh.is("1999-12-31", stamp.toISOString(cal.get("value"), {selector: "date"}), "value");
						doh.is("December", cal.gridNode.getAttribute("summary"));
					},

					function change(){
						cal.set("value", "2000-11-30");
						doh.is("2000-11-30", stamp.toISOString(cal.get("value"), {selector: "date"}), "value");
						doh.is("November", cal.gridNode.getAttribute("summary"));
					},

					function createWithSummary(){
						cal2 = new CalendarLite({
							id: "cal2",
							value: "1999-12-31",
							summary: "explicit summary"
						}, dom.byId("calendar2"));

						doh.is("explicit summary", cal2.gridNode.getAttribute("summary"));
					}

				]);
				doh.run();
			});
		</script>
	</head>
	<body class="claro" role="main">

		<h1 class="testTitle">Dijit CalendarLite Test</h1>

		<label for="before">before:</label><input value="input" id="before"/>
		<input id="calendar1"/>
		<label for="after">between:</label><input value="input" id="between"/>
		<input id="calendar2"/>
		<label for="after">after:</label><input value="input" id="after"/>
	</body>
</html>
